package com.luxk.db.errorcode;

public enum ErrorCodeServer implements ErrorCode {

	ERROR_CREATE_SERVER_INSTANCE(0,
			"Unable to create server instance",
			"Server configuration is invalid",
			"Check server configuration file(server.xml)"),

	ERROR_RAISE_SERVER_MODE(1,
			"Unable to change server mode from {0} to {1}",
			"Improperly server mode to raise",
			"Check current server mode and try again in proper mode");

	private final int codeOffset = 12000;
	private final int code;
	private final String desc;
	private final String cause;
	private final String action;
	
	private ErrorCodeServer(int id, String desc, String cause, String action) {
		this.code = this.codeOffset + id;
		this.desc = desc;
		this.cause = cause;
		this.action = action;
	}

	public int getCode() { return this.code; }
	public String getDesc() { return this.desc; }
	public String getCause() { return this.cause; }
	public String getAction() { return this.action; }
	public String toString() {
		return String.format("ERROR-%05d %s", this.code, this.desc);
	}
}
